package com.auxgroup.bridge.app.inner.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * kevin chen 新增 2017-09-08
 */
@ApiModel(value = "机智云新设备信息")
public class DeviceInfoNewVo implements Serializable {

    @ApiModelProperty(value = "兼容古北云与机智云的 deviceId")
    private String deviceId;

    @ApiModelProperty(value = "来源 0 古北（旧） ,1 机智云（新）")
    private Integer source;//0 古北 ,1 机智云

    private String productKey;

    private String mac;

    @ApiModelProperty(value = "机智云did")
    private String did;

    @ApiModelProperty(value = "适用类型 0：家用 1：商用")
    private Integer suitType;

    @ApiModelProperty(value = "挂机/柜机标识 0：挂机 1：柜机")
    private Integer useType;

    @ApiModelProperty(value = "经度")
    private String longitude;

    @ApiModelProperty(value = "维度")
    private String latitude;

    public DeviceInfoNewVo() {
    }

    public DeviceInfoNewVo(String deviceId, Integer source,
                           String productKey, String mac, String did) {
        this.deviceId = deviceId;
        this.source = source;
        this.productKey = productKey;
        this.mac = mac;
        this.did = did;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public Integer getSource() {
        return source;
    }

    public void setSource(Integer source) {
        this.source = source;
    }

    public String getProductKey() {
        return productKey;
    }

    public void setProductKey(String productKey) {
        this.productKey = productKey;
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    public String getDid() {
        return did;
    }

    public void setDid(String did) {
        this.did = did;
    }

    public Integer getSuitType() {
        return suitType;
    }

    public void setSuitType(Integer suitType) {
        this.suitType = suitType;
    }

    public Integer getUseType() {
        return useType;
    }

    public void setUseType(Integer useType) {
        this.useType = useType;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public DeviceInfoNewVo buidSuitAndUseType(Integer suitType, Integer useType){
        this.suitType = suitType;
        this.useType = useType;
        return this;
    }

    /**
     *  新设备  机智云的设备
     * @return
     */
    @JsonIgnore
    public boolean isNewDevice(){
        return source == 1 && StringUtils.isNotBlank(productKey) && StringUtils.isNotBlank(mac);
    }
}
